package com.rst.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.rst.dao.QualificationDAO;
import com.rst.model.Qualification;

@Service
public class QualificationService {
	
	@Autowired
	private QualificationDAO qualificationDAO;
	
	public void saveQualification(Qualification qualification) {
		qualificationDAO.saveQualification(qualification);		
	}

	public Qualification getQualificationById(Long qualificationId) {
		return qualificationDAO.getQualificationById(qualificationId);		
	}

	public List<Qualification> getQualificationList() {
		return qualificationDAO.getQualificationList();	
	}

	public String deleteQualificationList(Long qualificationId) {
		Qualification qualification  = qualificationDAO.getQualificationById(qualificationId);		
		qualification.setStatus(Qualification.INACTIVE);
		qualificationDAO.saveQualification(qualification);
		return "success";
	}

	
}
